

//
//  XJStatusModel.m
//  weiboOC
//
//  Created by 徐绩 on 16/4/22.
//  Copyright © 2016年 ayumi. All rights reserved.
//

#import "XJStatusModel.h"

@implementation XJStatusModel

-(instancetype)initWithDict:(NSDictionary *)dict{

    if (self = [super init]) {
        
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

/**
 *  字典转模型
 */
-(void)setValue:(id)value forKey:(NSString *)key{

    if ([key isEqualToString: @"user"] && [value isKindOfClass:[NSDictionary class]]) {
        
        self.user = [XJUserModel userModelWithDict:value];
    }else if([key isEqualToString:@"retweeted_status"]  && [value isKindOfClass:[NSDictionary class]]){
    
        self.retweeted_status = [XJStatusModel statusModelWithDict:value];
    }else{
    
        [super setValue:value forKey:key];
    }
    
}

+(instancetype)statusModelWithDict:(NSDictionary *)dict{

    return [[self alloc]initWithDict:dict];
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{}

@end
